package com.itheima.test2;

import com.itheima.domain.Student;

import java.io.EOFException;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class Test02 {

    public static void main(String[] args) throws Exception{
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("day13\\students.txt"));
        while (true) {
            try {
                Student s= (Student) ois.readObject();
                System.out.println(s);
            } catch (EOFException e) {
                System.out.println("到头了");
                break;
            }
        }

       // ois.close();

    }
}
